// JavaScript Document
function restrictArea(perfilUsuario){

    var codPerfil = perfilUsuario;
    if (codPerfil == 1){
        alert("GRATZ");
        return true;
    }else{
        alert("FAIL");
        return false;
    }
}


function reseta (codTabela) {
	
	var cod = codTabela;

	
	if (cod == 1) {
		document.getElementById("menuEventos").style.display = "inline";
		document.getElementById("menuPessoas").style.display = "none";
		document.getElementById("menuCertificados").style.display = "none";
		document.getElementById("menuRelatorios").style.display = "none";
		document.getElementById("menuFornecedores").style.display = "none";
		document.getElementById("menuFinanceiro").style.display = "none";
		document.getElementById("menuMonitor").style.display = "none";
		document.getElementById("menuConfig").style.display = "none";
                document.getElementById("menuCursos").style.display = "none";
	}
	
	if (cod == 2) {
		document.getElementById("menuEventos").style.display = "none";
		document.getElementById("menuPessoas").style.display = "inline";
		document.getElementById("menuCertificados").style.display = "none";
		document.getElementById("menuRelatorios").style.display = "none";
		document.getElementById("menuFornecedores").style.display = "none";
		document.getElementById("menuFinanceiro").style.display = "none";
		document.getElementById("menuMonitor").style.display = "none";
		document.getElementById("menuConfig").style.display = "none";
                document.getElementById("menuCursos").style.display = "none";
	}
	
	if (cod == 3) {
		document.getElementById("menuEventos").style.display = "none";
		document.getElementById("menuPessoas").style.display = "none";
		document.getElementById("menuCertificados").style.display = "inline";
		document.getElementById("menuRelatorios").style.display = "none";
		document.getElementById("menuFornecedores").style.display = "none";
		document.getElementById("menuFinanceiro").style.display = "none";
		document.getElementById("menuMonitor").style.display = "none";
		document.getElementById("menuConfig").style.display = "none";
                document.getElementById("menuCursos").style.display = "none";
	}
	
	if (cod == 4) {
		document.getElementById("menuEventos").style.display = "none";
		document.getElementById("menuPessoas").style.display = "none";
		document.getElementById("menuCertificados").style.display = "none";
		document.getElementById("menuRelatorios").style.display = "inline";
		document.getElementById("menuFornecedores").style.display = "none";
		document.getElementById("menuFinanceiro").style.display = "none";
		document.getElementById("menuMonitor").style.display = "none";
		document.getElementById("menuConfig").style.display = "none";
                document.getElementById("menuCursos").style.display = "none";
	}
	
	if (cod == 5) {
		document.getElementById("menuEventos").style.display = "none";
		document.getElementById("menuPessoas").style.display = "none";
		document.getElementById("menuCertificados").style.display = "none";
		document.getElementById("menuRelatorios").style.display = "none";
		document.getElementById("menuFornecedores").style.display = "inline";
		document.getElementById("menuFinanceiro").style.display = "none";
		document.getElementById("menuMonitor").style.display = "none";
		document.getElementById("menuConfig").style.display = "none";
                document.getElementById("menuCursos").style.display = "none";
	}
	
	if (cod == 6) {
		document.getElementById("menuEventos").style.display = "none";
		document.getElementById("menuPessoas").style.display = "none";
		document.getElementById("menuCertificados").style.display = "none";
		document.getElementById("menuRelatorios").style.display = "none";
		document.getElementById("menuFornecedores").style.display = "none";
		document.getElementById("menuFinanceiro").style.display = "inline-table";
		document.getElementById("menuMonitor").style.display = "none";
		document.getElementById("menuConfig").style.display = "none";
                document.getElementById("menuCursos").style.display = "none";
	}
	
	if (cod == 7) {
		document.getElementById("menuEventos").style.display = "none";
		document.getElementById("menuPessoas").style.display = "none";
		document.getElementById("menuCertificados").style.display = "none";
		document.getElementById("menuRelatorios").style.display = "none";
		document.getElementById("menuFornecedores").style.display = "none";
		document.getElementById("menuFinanceiro").style.display = "none";
		document.getElementById("menuMonitor").style.display = "inline";
		document.getElementById("menuConfig").style.display = "none";
                document.getElementById("menuCursos").style.display = "none";
	}
	
	if (cod == 8) {
		document.getElementById("menuEventos").style.display = "none";
		document.getElementById("menuPessoas").style.display = "none";
		document.getElementById("menuCertificados").style.display = "none";
		document.getElementById("menuRelatorios").style.display = "none";
		document.getElementById("menuFornecedores").style.display = "none";
		document.getElementById("menuFinanceiro").style.display = "none";
		document.getElementById("menuMonitor").style.display = "none";
		document.getElementById("menuConfig").style.display = "inline";
                document.getElementById("menuCursos").style.display = "none";
	}

        if (cod == 9) {
                document.getElementById("menuEventos").style.display = "none";
		document.getElementById("menuPessoas").style.display = "none";
		document.getElementById("menuCertificados").style.display = "none";
		document.getElementById("menuRelatorios").style.display = "none";
		document.getElementById("menuFornecedores").style.display = "none";
		document.getElementById("menuFinanceiro").style.display = "none";
		document.getElementById("menuMonitor").style.display = "none";
		document.getElementById("menuConfig").style.display = "none";
                document.getElementById("menuCursos").style.display = "inline";
	}
}


function menuEventos () {

        var codPerfil = document.getElementById("form:codPerfil").value;
        if (codPerfil == 1){
            reseta(1);
        }
}

function menuPessoas () {
	
        reseta(2);

}

function menuCertificados () {

        reseta(3);
            
}

function menuRelatorios () {
	
	var codPerfil = document.getElementById("form:codPerfil").value;
        if (codPerfil == 1){
            reseta(4);
        }
        if (codPerfil == 2){
            reseta(4);
        }
}

function menuFornecedores () {
	
	var codPerfil = document.getElementById("form:codPerfil").value;
        if (codPerfil == 1){
            reseta(5);
        }
	
}

function menuFinanceiro () {
	
	var codPerfil = document.getElementById("form:codPerfil").value;
        if (codPerfil == 1){
            reseta(6);
        }
        if (codPerfil == 2){
            reseta(6);
        }
}

function menuMonitor () {
	
	var codPerfil = document.getElementById("form:codPerfil").value;
        if (codPerfil == 1){
            reseta(7);
        }
        if (codPerfil == 2){
            reseta(7);
        }
}

function menuConfig () {
	
	var codPerfil = document.getElementById("form:codPerfil").value;
        if (codPerfil == 1){
            reseta(8);
        }
}

function menuCursos () {

	var codPerfil = document.getElementById("form:codPerfil").value;
        if (codPerfil == 1){
            reseta(9);
        }
        if (codPerfil == 2){
            reseta(9);
        }
}